/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.opgea.tutor.domain.entities;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.opgea.tutor.domain.qualifiers.UserType;

/**
 * 
 * @author Ramesh
 */
@Entity
@Table(name = "login")
public class Login implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 38044300992193996L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;
    private String loginId;
    private String password;
    private Boolean isActive;
    @Enumerated(EnumType.STRING)
    private UserType userType;

    public Login() {
    }

    public long getId() {
	return id;
    }

    public void setId(long id) {
	this.id = id;
    }

    public Boolean getIsActive() {
	return isActive;
    }

    public void setIsActive(Boolean isActive) {
	this.isActive = isActive;
    }

    public String getLoginId() {
	return loginId;
    }

    public void setLoginId(String loginId) {
	this.loginId = loginId;
    }

    public String getPassword() {
	return password;
    }

    public void setPassword(String password) {
	this.password = password;
    }

    public UserType getUserType() {
	return userType;
    }

    public void setUserType(UserType userType) {
	this.userType = userType;
    }

    @Override
    public int hashCode() {
	final int prime = 31;
	int result = 1;
	result = prime * result + (int) (id ^ (id >>> 32));
	return result;
    }

    @Override
    public boolean equals(Object obj) {
	if (this == obj)
	    return true;
	if (obj == null)
	    return false;
	if (getClass() != obj.getClass())
	    return false;
	Login other = (Login) obj;
	if (id != other.id)
	    return false;
	return true;
    }

    @Override
    public String toString() {
	return "Login [id=" + id + ", loginId=" + loginId + ", password="
		+ password + ", isActive=" + isActive + ", userType="
		+ userType + "]";
    }

}
